package com.catmiao.ai.controller;

import com.catmiao.ai.assistant.ChatAssistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ai/")
public class AIController {

    @Resource
    private ChatAssistant chatAssistant;

    @GetMapping("/chat")
    public String chat(@RequestParam(defaultValue = "介绍下衡阳的美食") String prompt) {
        return chatAssistant.chat(prompt);
    }
}
